Redundant arrays of inexpensive disks (RAIDs) provide for reliable storage of payload data by storing additional data in some of the disks of the array. The design of a RAID involves ensuring that, if some number of disks fails, then the data stored in those disks may be recovered from other disks in the array.
Some RAIDs apply codes to segments of payload data to create codewords on the disks of an array. In this manner, in the event of a failure, a RAID controller is able to recover the payload data from those codewords. In some cases, the codes are systematic in that the codewords contain the payload data plus some parity data. The payload data and parity data are stored in payload disks and parity disks, respectively, within the array. The RAID controller is then able to recover data from a maximum number of failed payload disks from the parity disks. The number of payload disks from which data may be recovered depends on the number of parity disks in use.
At some point in time, an application may need to update small blocks of data in a payload disk. In order to accomplish such an update while preserving the integrity of the parity data, a conventional RAID system has the RAID controller update certain parity data along with the payload data. Along these lines, the RAID controller reads current payload data from a block on a payload disk. Before replacing the current payload data with new payload data, however, the RAID controller computes the difference between the current and new payload data and stores that difference in memory. The RAID controller then computes a correction to corresponding parity data from that difference. After computing this correction, the RAID controller locates the corresponding block containing current parity data on a parity disk, reads the current value of the parity data, adds the correction to the current parity data to produce new parity data, and stores the new parity data to that block in the parity disk.